/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package negocio;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Dvid
 */
@Embeddable
public class AntecedentePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "empid")
    private String empid;
    @Basic(optional = false)
    @Column(name = "enfermid")
    private int enfermid;

    public AntecedentePK() {
    }

    public AntecedentePK(String empid, int enfermid) {
        this.empid = empid;
        this.enfermid = enfermid;
    }

    public String getEmpid() {
        return empid;
    }

    public void setEmpid(String empid) {
        this.empid = empid;
    }

    public int getEnfermid() {
        return enfermid;
    }

    public void setEnfermid(int enfermid) {
        this.enfermid = enfermid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (empid != null ? empid.hashCode() : 0);
        hash += (int) enfermid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AntecedentePK)) {
            return false;
        }
        AntecedentePK other = (AntecedentePK) object;
        if ((this.empid == null && other.empid != null) || (this.empid != null && !this.empid.equals(other.empid))) {
            return false;
        }
        if (this.enfermid != other.enfermid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "negocio.AntecedentePK[ empid=" + empid + ", enfermid=" + enfermid + " ]";
    }
    
}
